<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>千园千变，万班万课</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="icon" type="image/png" href="assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
    <link rel="stylesheet" href="assets/css/amazeui.min.css"/>
    <link rel="stylesheet" href="assets/css/admin.css">
    <link rel="stylesheet" href="assets/css/app.css">
</head>
<body>
<div class="tpl-portlet-components">
    <div class="portlet-title">
        <ol class="am-breadcrumb">
            <li><a href="#" class="am-icon-home">首页</a></li>
            <li><a href="#">表单</a></li>
            <li class="am-active">Amaze UI 表单</li>
        </ol>
    </div>
    <div class="tpl-block ">
        <div class="am-g tpl-amazeui-form">
            <div class="am-u-sm-12">
                <form class="am-form am-form-horizontal">
                    <div class="am-form-group check_permission[0,1]"  >
                        <label class="am-u-sm-2 am-form-label" style="color:#f00;font-weight: bold;font-size: 15px" >账户余额</label>
                        <div class="am-u-sm-10 line">
                           <b  class="am-form-label" style="color:#f00;font-weight: bold;font-size: 15px"> &yen;<font id="accountBalance">100</font></b>
                        </div>
                    </div>
                    <div class="am-form-group">
                        <label for="money" class="am-u-sm-2 am-form-label">提现金额</label>
                        <div class="am-u-sm-10">
                            <input type="number" id="money" name="money"
                                   class="verification[required]" data-info="提现金额"  style="width: 150px" placeholder="输入提现金额">
                            <span class="tips"> </span>
                        </div>
                    </div>
                    <div class="am-form-group">
                        <div class="am-u-sm-9 am-u-sm-push-2">
                            <button type="button" class="am-btn am-btn-primary" id="submitBtn">提现</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>

</div>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/amazeui.min.js"></script>
<script src="assets/js/layer.js"></script>
<script src="assets/js/jquery.cookie.js"></script>
<script src="assets/js/md5.min.js"></script>
<script src="assets/js/verification.js"></script>
<script src="assets/js/request.js"></script>
<script src="assets/js/jquery.pagination.js"></script>
<script src="assets/js/jquery.serializejson.min.js"></script>
<script src="assets/js/jquery.params.js"></script>
<script src="assets/js/app.js"></script>
<script>
function getCashInfo () {
  AjaxRequest({
    url:'/agent/get_balance/',
    succFun: function (res) {
      $('#accountBalance').html(res.data)
    }
  })
}
getCashInfo()
var isLoading=false
$('#submitBtn').click(function (e) {
    e.preventDefault()
  if(isLoading) return false;
  isLoading=true
  if (Verification()) {
    var formData = $('form').serializeJSON()
    AjaxRequest({
      url:'/agent/receive/',
      data: formData,
      succFun: function (res) {
        layer.msg(res.message, {icon: 1, time: 1000}, function () {
          getCashInfo()
        })
      },
      complete:function () {
        isLoading=false
      }
    })
  }
})
</script>
</body>
</html>